AttrType at =find(module, string)

in a dxl skript i havent wrote is a column:

AttrType at = find(curMod, "RBEAllocation")
int iRBEAllocationSize = at.size

what does this program make?

i found 10 different rbe Allocation
but the result(at.size) is 16

can anybody help me?
SystemAdmin - Thu Jun 04 07:56:54 EDT 2009

Re: AttrType at =find(module, string)
Ron_Lewis - Thu Jun 04 08:41:20 EDT 2009

It appears that an attribute has type that has 16 different enumeration possibilities.

Also appears based on what you said, only 10 of the 16 different enumerations have been used.

Re: AttrType at =find(module, string)
SystemAdmin - Thu Jun 04 08:42:42 EDT 2009

Your enumerated type definition for "RBEAllocation" has 16 different values. Do you by 10 that only 10 of them are given as values to an attribute which uses this type?

Re: AttrType at =find(module, string)
SystemAdmin - Thu Jun 04 08:55:19 EDT 2009

i don't know what you mean!

But my problem is that i should rebuild this script with the Telelogic Publishing Engine and there isn't the function find, can anybody gives me the code what find makes in this example

thanks

Re: AttrType at =find(module, string)
Tony_Goodman - Fri Jun 05 03:29:49 EDT 2009

SystemAdmin - Thu Jun 04 08:55:19 EDT 2009
i don't know what you mean!

But my problem is that i should rebuild this script with the Telelogic Publishing Engine and there isn't the function find, can anybody gives me the code what find makes in this example

thanks

The attribute type has 16 possible enumerated values.
The attribute based on that type only uses 10 of those values.

I am guessing that you want a list of values that have been used, not a list of possible values.
The following script displays all the values that have been used for an attribute.
Don't forget that for most attributes, one of these will be an empty string.

//  List Attribute Values
 
/*
*/
 
DB db = null
DBE dbeResults = null
DBE dbeAttr = null
 
Buffer resBuf = null
 
void doList(DB db)
{
    resBuf = create
 
        string attr = get(dbeAttr)
 
        Module m = current
        Object o = null
 
        //print("Values found for attribute \"" attr"\"\n")
 
        Skip attrValues = createString
        string s = ""
 
        for o in m do
        {
                s = o.attr""
        
                if (!find(attrValues, s))
                {
                        put(attrValues, s, s)
                }
 
        }
 
        for s in attrValues do
        {
                resBuf += "\"" s "\"\n"
        }
 
        delete(attrValues)
        attrValues = null
 
        set(dbeResults, tempStringOf(resBuf))
 
        delete(resBuf)
        resBuf = null
}
 
db = create(current Module, "List Attribute Values")
 
label(db, "This utility lists all the different values found for the given attribute.\n")
dbeAttr = field(db, "Attribute:", "", 30, false)
 
dbeResults = text(db, "Results", "", 60, 150, false)
 
apply(db,"OK", doList)
 
realize(db)
 
show(db)